import { pagerProps } from '@/components/Table'
import { formatTDate } from '@/utils/common'
import dayjs from 'dayjs'
import { createContext } from 'react'
import { FilterDataProps } from './interface'

export const defaultFilterData = {
	detail: '', //账号/姓名/邮箱/入会号码
	accountName: '', //用户 姓名
	subjectName: '',
	nameCodeLevel: '', //事件客体
	logRiskLevel: '', //日志风险级别
	type: '', //操作类型
	startDate: null, //开始时间
	endDate: null, //结束时间
	page: 1,
	size: 15,
}
export interface FilterParamsProps extends FilterDataProps, pagerProps {
	detail: any
	subjectName: any
	accountName: any
}
export interface FilterContextProps {
	params: FilterParamsProps
	setParams: Function
	filterData: FilterDataProps
	setFilterData: Function
	showPieChart: Function
	type: string
	passwordConfirm: Function
	showPasswordDialog: Function
}
export const FilterContext = createContext<FilterContextProps>({
	params: defaultFilterData,
	setParams: () => {},
	filterData: defaultFilterData,
	setFilterData: () => {},
	showPieChart: () => {},
	type: '',
	passwordConfirm: () => {},
	showPasswordDialog: (v: boolean) => {},
})
